(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  ["pages/user/auth/auth"], {
    "085b": function (e, t, n) {
      "use strict";
      n.r(t);
      var o = n("59ec"),
        a = n.n(o);
      for (var c in o) "default" !== c && function (e) {
        n.d(t, e, (function () {
          return o[e]
        }))
      }(c);
      t["default"] = a.a
    },
    "27b3": function (e, t, n) {
      "use strict";
      var o = n("b5b6"),
        a = n.n(o);
      a.a
    },
    "59ec": function (e, t, n) {
      "use strict";
      (function (e) {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.default = void 0;
        var o = a(n("565b"));

        function a(e) {
          return e && e.__esModule ? e : {
            default: e
          }
        }
        var c = {
          data: function () {
            return {
              pmodel:'',
              submitDisabled: !0,
              providerList: [],
              loginRes: {},
              pageroute: ""
            }
          },
          onLoad: function (t) {
            var that = this
            wx.getSystemInfo({
              success(res) {
                that.pmodel = res.model

              }
            })

            var n = this,
              o = this.$wanlshop.prePage().$mp.page;
            this.pageroute = encodeURIComponent("/".concat(o.route, "?").concat(this.queryParams(o.options))), e.getProvider({
              service: "oauth",
              success: function (e) {
                n.providerList = e.provider.map((function (e) {
                  var t = "",
                    n = "";
                  switch (e) {
                    case "weixin":
                      t = "wlIcon-WeChat", n = "mp_weixin";
                      break;
                    case "qq":
                      t = "wlIcon-QQ", n = "mp_qq";
                      break;
                    case "sinaweibo":
                      t = "wlIcon-WeiBo", n = "app_weibo";
                      break;
                    case "xiaomi":
                      t = "wlIcon-Xiaomi", n = "app_xiaomi";
                      break;
                    case "apple":
                      t = "wlIcon-Apple", n = "apple";
                      break
                  }
                  return {
                    id: e,
                    name: t,
                    platform: n
                  }
                }))
              },
              fail: function (e) {

              }
            }), e.login({
              provider: "weixin",
              success: function (e) {

                n.loginRes = e
              },
              fail: function (e) {
                n.$wanlshop.msg(e.msg)
              }
            })
          },
          methods: {
            tologin: function (t) {
              var n = this;
              e.showLoading({
                title: "登录中"
              }), e.login({
                provider: t.id,
                success: function (o) {
                  n.$api.post({
                    url: "/wanlshop/user/third",
                    data: {
                      platform: t.platform,
                      loginData: o,
                      client_id: e.getStorageSync("wanlshop:chat_client_id") ? e.getStorageSync("wanlshop:chat_client_id") : null
                    },
                    success: function (o) {
                      e.hideLoading(), 0 == o.binding ? n.$wanlshop.to("/pages/user/auth/perfect?third_id=".concat(o.third_id, "&platform=").concat(t.platform, "&url=").concat(n.pageroute)) : (n.$store.dispatch("user/login", o), n.$store.dispatch("cart/login"), n.$store.dispatch("chat/get"), e.reLaunch({
                        url: decodeURIComponent(n.pageroute)
                      }))
                    }
                  }), e.hideKeyboard()
                },
                fail: function (e) {
                  n.$wanlshop.msg(e.msg)
                }
              })
            },
            onKeyInput: function (e) {
              this.submitDisabled = !1
            },
            decryptPhoneNumber: function (t) {
              var n = this;
              if(wx.getStorageSync("qudao")){
                var qudao = wx.getStorageSync("qudao")
              }else{
                var qudao = 0
              }
              "getPhoneNumber:fail user deny" != t.detail.errMsg && this.$api.post({
                url: "/wanlshop/user/phone",
                data: {
                  encryptedData: t.detail.encryptedData,
                  iv: t.detail.iv,
                  code: this.loginRes.code,
                  qudao:qudao,
                  client_id: e.getStorageSync("wanlshop:chat_client_id") ? e.getStorageSync("wanlshop:chat_client_id") : null
                },
                success: function (t) {


                  n.$store.dispatch("user/login", t), n.$store.dispatch("cart/login"),
                  wx.request({
                    url: 'https://www.xiaoyudiyimei.cn/api/index/tongji',
                    data: {
                      uid: wx.getStorageSync("wanlshop:user").id,
                      xinghao:n.pmodel
                    },
                    success:function(res){

                    }
                  })
                  e.reLaunch({
                    url: decodeURIComponent(n.pageroute)
                  })
                }
              })
            },
            formSubmit: function (e) {
              var t = [{
                  name: "mobile",
                  checkType: "phoneno",
                  errorMsg: "请输入正确的手机号"
                }],
                n = e.detail.value,
                a = o.default.check(n, t);
              a ? this.$wanlshop.to("validcode?event=mobilelogin&mobile=".concat(e.detail.value.mobile, "&url=").concat(this.pageroute), "slide-in-bottom", 200) : this.$wanlshop.msg(o.default.error)
            },

            register: function () {
              this.$wanlshop.to("register?url=".concat(this.pageroute))
            },
            help: function () {
              this.$wanlshop.to("/pages/user/help?url=".concat(this.pageroute))
            },
            queryParams: function (e) {
              var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
                n = t ? "?" : "",
                o = [],
                a = function (t) {
                  var n = e[t];
                  if (["", void 0, null].includes(n)) return "continue";
                  n.constructor === Array ? n.forEach((function (e) {
                    o.push(encodeURIComponent(t) + "[]=" + encodeURIComponent(e))
                  })) : o.push(encodeURIComponent(t) + "=" + encodeURIComponent(n))
                };
              for (var c in e) a(c);
              return o.length ? n + o.join("&") : ""
            }
          }
        };
        t.default = c
      }).call(this, n("543d")["default"])
    },
    "7f23": function (e, t, n) {
      "use strict";
      n.r(t);
      var o = n("a472"),
        a = n("085b");
      for (var c in a) "default" !== c && function (e) {
        n.d(t, e, (function () {
          return a[e]
        }))
      }(c);
      n("27b3");
      var i, r = n("f0c5"),
        u = Object(r["a"])(a["default"], o["b"], o["c"], !1, null, null, null, !1, o["a"], i);
      t["default"] = u.exports
    },
    a472: function (e, t, n) {
      "use strict";
      var o;
      n.d(t, "b", (function () {
        return a
      })), n.d(t, "c", (function () {
        return c
      })), n.d(t, "a", (function () {
        return o
      }));
      var a = function () {
          var e = this,
            t = e.$createElement;
          e._self._c
        },
        c = []
    },
    b5b6: function (e, t, n) {},
    ebea: function (e, t, n) {
      "use strict";
      (function (e) {
        n("77a0");
        o(n("66fd"));
        var t = o(n("7f23"));

        function o(e) {
          return e && e.__esModule ? e : {
            default: e
          }
        }
        e(t.default)
      }).call(this, n("543d")["createPage"])
    }
  },
  [
    ["ebea", "common/runtime", "common/vendor"]
  ]
]);
